package com.linkwechat.wecom.client;

import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Request;
import com.dtflys.forest.annotation.Retry;
import com.linkwechat.wecom.domain.dto.kf.*;
import com.linkwechat.wecom.interceptor.WeKfAccessTokenInterceptor;
import com.linkwechat.wecom.retry.WeCommonRetryWhen;

/**
 * Created by Administrator on 2022-1-15.
 */

@BaseRequest(baseURL = "${weComServerUrl}${weComePrefix}", interceptor = WeKfAccessTokenInterceptor.class)
@Retry(maxRetryCount = "3", maxRetryInterval = "1000", condition = WeCommonRetryWhen.class)
public interface WeKfClient {
    //获取会话状态
    @Request(url = "/kf/service_state/get",
            type = "POST"
    )
    ServiceStateGetResDto getServiceState(@JSONBody ServiceStateGetDto serviceStateGetDto);

    //变更会话状态
    @Request(url = "/kf/service_state/trans",
            type = "POST"
    )
    ServiceStateTransResDto transServiceState(@JSONBody ServiceStateTransDto serviceStateTransDto);

    //读取消息
    @Request(url = "/kf/sync_msg",
            type = "POST"
    )
    SyncMsgResDto syncMsg(@JSONBody SyncMsgDto syncMsgDto);



}
